import Vue from 'vue'
import Router from 'vue-router'

const home = resolve => require(['@/components/home'], resolve);

const groupBusiness = resolve => require(['@/components/groupBusiness'], resolve);
const aboutQx = resolve => require(['@/components/aboutQx'], resolve);
const news = resolve => require(['@/components/news'], resolve);
const join = resolve => require(['@/components/join'], resolve);
const contact = resolve => require(['@/components/contact'], resolve);
const newsDetail = resolve => require(['@/components/newsDetail'], resolve);
const houseList = resolve => require(['@/components/houseList'], resolve);
const projectDisplay = resolve => require(['@/components/projectDisplay'], resolve);

//患者管理
// const patientList = resolve => require(['@/components/patientManage/patientList'], resolve)
// const patientDetail = resolve => require(['@/components/patientManage/patientDetail'], resolve)
// const recordList = resolve => require(['@/components/patientManage/recordList'], resolve)
// const recordDetail = resolve => require(['@/components/patientManage/recordDetail'], resolve)

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/',
      name: 'home',
      meta: {
        title: '侨信集团'
      },
      component: home
    },
    {
      path: '/groupBusiness',
      name: 'groupBusiness',
      meta: {
        title: '集团业务'
      },
      component: groupBusiness
    },
    {
      path: '/aboutQx',
      name: 'aboutQx',
      meta: {
        title: '走进侨信'
      },
      component: aboutQx
    },
    {
      path: '/news',
      name: 'news',
      meta: {
        title: '新闻'
      },
      component: news
    },
    {
      path: '/join',
      name: 'join',
      meta: {
        title: '加入侨信'
      },
      component: join
    },
    {
      path: '/contact',
      name: 'contact',
      meta: {
        title: '联系我们'
      },
      component: contact
    },
    {
      path: '/newsDetail',
      name: 'newsDetail',
      meta: {
        title: '联系我们'
      },
      component: newsDetail
    },
    {
      path: '/houseList',
      name: 'houseList',
      meta: {
        title: '房产列表'
      },
      component: houseList
    },
    {
      path: '/projectDisplay',
      name: 'projectDisplay',
      meta: {
        title: '地产'
      },
      component: projectDisplay
    }
  ],
  // scrollBehavior (to, from, savedPosition) {
  //     console.log(from, savedPosition)
  //     if (to.hash) {
  //         return {
  //             selector: to.hash
  //         }
  //     }
  // }
})
